<!--首页-->
<link href="<%- Virtual_Path.Static %>main/css/imax.css" rel="stylesheet"/>
<script src="<%- Virtual_Path.Static %>/jquery.plugin/masonry.pkgd/4.1.1/masonry.pkgd.min.js"></script>
<script src="<%- Virtual_Path.Static %>main/js/slide.js"></script>
<!-- start MainContent -->

<!-- host wall start -->
<div class="host-wall-wrap">
    <div class="host-wall" id="J_HostWall">

    </div>
</div>
<!-- host wall end -->

<div class="xiu-container">
    <div class="xiu-main">
        <!--<div class="xiutv-banner">-->
        <!--<div class="slider">-->
        <!--<div class="slideInner" id="J_SlideMainBanner">-->
        <!--<a href="/help/help-9-3" target="_blank" alt=""-->
        <!--style="background: url('http://cdn.cos.xiutv.com/image/activity/2016/slide/2017022801.png') no-repeat center top;height:146px;display:block;"></a>-->
        <!--<a href="/zt/zhengjing" target="_blank" alt="正经男女" style="background: url('http://cdn.cos.xiutv.com/image/activity/2016/slide/121201.jpg') no-repeat center top;height:146px;display:block;"></a>-->
        <!--</div>-->
        <!--</div>-->
        <!--</div>-->

        <!--周星榜-->
        <div class="xiu-week" style="display: none;">
            <h4 class="column-hd clearfix">
                <span class="title"><i class="ico-title-week"></i>周星榜</span>
            </h4>
            <div class="column-bd clearfix">
                <div class="xiu-week-content" id="J_AnchorWeekRank">
                    <div class="week-cont" id="J_AnchorWeekRankList" style="transition:margin 0.5s ease">

                    </div>
                    <a href="javascript:;" class="move-arrow-l" id="J_AnchorWeekBtnL"></a>
                    <a href="javascript:;" class="move-arrow-r" id="J_AnchorWeekBtnR"></a>
                </div>
            </div>
        </div>

        <!--后起之秀-->
        <div class="xiu-new" style="margin-top:0px;">
            <h4 class="column-hd clearfix">
                <span class="title"><i class="ico-title-new"></i>后起之秀</span>
            </h4>
            <div class="column-bd clearfix">
                <div class="xiu-new-content" id="J_AnchorNewList">
                </div>
            </div>
        </div>

        <!--new all -->
        <div class="xiu-all-anchor">
            <h4 class="column-hd clearfix">
                <span class="title"><i class="ico-title-all"></i>全部艺人</span>
            </h4>
            <div class="column-bd all-host-col clearfix" id="J_AllAnchor">
            </div>
        </div>

    </div>
    <div class="main-side">
        <!-- user login -->
        <div class="aside-mod profile-mod-login" id="J_ProfileLogin">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>登录账号</span>
            </h4>
            <div class="profile-login-form">
                <a href="javascript:void(0);" onclick="_czc.push(['_trackEvent', '首页登录', '登录', '首页登录']);" class="btn-login" UserSign="In">立即登录</a>
                <div class="login-holder" style="padding-bottom: 0px;">
                    <div class="login-top-line">
                    第三方登录
                    </div>
                    <div class="login-account">
                    <a href="javascript:;" title="微博帐号登录" class="btn-weibo" UserOAuth="Weibo" onclick="_czc.push(['_trackEvent', '首页微博登录', '微博登录','首页微博登录']);"><i></i>新浪微博</a>
                    <a href="javascript:;" title="QQ" class="btn-qq" UserOAuth="QQ" onclick="_czc.push(['_trackEvent', '首页QQ登录', 'QQ登录','首页QQ登录']);"><i></i>QQ</a>
                    <a href="javascript:;" title="微信" class="btn-weixin" UserOAuth="Weixin" onclick="_czc.push(['_trackEvent', '首页微信登录', '微信登录','首页微信登录']);"><i></i>微信</a>
                    </div>
                </div>
            </div>
        </div>
        <!-- user login end -->

        <!-- user profile -->
        <div class="aside-mod profile-mod" id="J_ProfileUserInfo">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>个人信息</span>
                <a href="javascript:;" class="profile-ctrl-exit" UserSign="Out"><i></i></a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <div class="profile-box">
                        <div class="profile-member">
                            <div class="profile-userinfo-head">
                                <div class="profile-userinfo-cover">
                                    <a target="_blank" href="/member/user/follow"><img id="J_UserInfo_Cover" class="userinfo-cover" alt="bnull"></a>
                                </div>
                                <p class="profile-userinfo-name"><a href="javascript:;" id="J_UserInfo_Nickname">-</a></p>
                                <p class="profile-userinfo-id" id="J_UserInfo_ID">ID:-</p>
                            </div>
                            <p class="profile-userinfo-le">金币：<span id="J_UserInfo_Coin" class="coin">-</span></p>
                            <p class="profile-userinfo-le">金豆：<span id="J_UserInfo_Bean" class="bean">-</span></p>

                            <div class="profile-process-bar">
                                <div class="profile-process-bar-percentage" style="width:0%;" id="J_MUser_Exp"></div>
                            </div>
                            <div class="profile-ctrl-btn">
                                <!--<a href="/pay/" class="profile-ctrl-pay" target="_blank"><i></i>我要充值</a>-->
                                <a href="/member/user/" class="profile-ctrl-member" target="_blank"><i></i>个人中心</a>
                                <a href="javascript:;" class="profile-ctrl-live" target="_blank" id="J_ProfileCtrlLive"><i></i>我要开播</a>
                                <a href="javascript:;" class="profile-ctrl-entry" target="_blank" id="J_ProfileCtrlEntry"><i></i>申请入驻</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- user profile end -->

        <div class="aside-mod follow-mod" id="J_MyFollowMod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>我的关注</span>
                <a href="/member/user/follow/" class="morelink" target="_blank">更多&gt;</a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <ul class="introlist" id="J_MyFollowList">
                    </ul>
                </div>
            </div>
        </div>

        <div class="aside-mod activities-mod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>官方活动</span>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <div class="official-hd">
                        <!--<a href="/rank/#J_WeekRank" target="_blank">-->
                        <!--<img src="http://cdn.cos.xiutv.com/image/activity/2016/homepage_right/16101201.png" alt="周星争夺战">-->
                        <!--</a>-->
                        <a href="/activity/2016/firstpay/" target="_blank">
                            <img src="http://cdn.cos.xiutv.com/image/activity/2016/homepage_right/16101202.png" alt="首冲">
                        </a>
                    </div>
                </div>
            </div>
        </div>

        <div class="aside-mod richrank-mod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>富豪榜</span>
                <a href="/rank/" class="morelink" target="_blank">更多&gt;</a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <ul class="introlist" id="J_RichRankList">

                    </ul>
                </div>
            </div>
        </div>

        <div class="aside-mod starrank-mod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>明星榜</span>
                <a href="/rank/" class="morelink" target="_blank">更多&gt;</a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <ul class="introlist" id="J_StarRankList">

                    </ul>
                </div>
            </div>
        </div>

        <div class="aside-mod bulletin-mod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>公告</span>
                <a href="javascript:;" class="morelink">更多&gt;</a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <ul class="newlist">
                        <li><a href="/help/help-9-3" target="_blank" title="艺人待遇新政策">艺人待遇新政策</a></li>
                        <li><a href="/help/help-9-2" target="_blank" title="艺⼈全民秀网礼物系统升级公告">全民秀网礼物系统升级公告</a></li>
                        <li><a href="/help/help-6-4" target="_blank" title="APP新规定">APP新规定</a></li>
                        <li><a href="http://mp.weixin.qq.com/s?__biz=MzAxNzcxMjk4Ng==&mid=2247483667&idx=1&sn=924330e7498caefed5d5e4dedbad8ce7&chksm=9be01326ac979a30a0c48e64deb8c4a41b3beba8e629ede481d8e3f2637c0b66891ee703a830&scene=4#wechat_redirect" target="_blank" title="《互联网直播服务管理规定》 ">全民秀网积极响应《互联网直播服务管理规定》 </a></li>
                        <li><a href="/help/help-6-1" target="_blank" title="贯彻《移动互联网应用程序信息服务管理规定》的措施">贯彻《移动互联网应用程序信息服务管理...</a></li>
                        <li><a href="/help/help-6-2" target="_blank" title="落实《关于加强网络表演管理工作的通知》的办法">落实《关于加强网络表演管理工作的通知...</a></li>
                        <li><a href="/help/help-6-3" target="_blank" title="坚持净网行动，共创绿色、健康的网络直播家园的通知">坚持净网行动，共创绿色、健康的网络直...</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="aside-mod help-mod">
            <h4 class="aside-mod-hd">
                <span class="title"><i></i>帮助</span>
                <a href="/help/" class="morelink" target="_blank">更多&gt;</a>
            </h4>
            <div class="aside-mod-bd">
                <div class="cont">
                    <ul class="newlist">
                        <li><a href="/help/help-1-1" target="_blank">如何注册账号</a></li>
                        <li><a href="/help/help-1-2" target="_blank">如何找回账号和密码</a></li>
                        <li><a href="/help/help-1-3" target="_blank">用户等级</a></li>
                        <li><a href="/help/help-2-1" target="_blank">艺人等级</a></li>
                        <li><a href="/help/help-3-1" target="_blank">如何充值</a></li>
                        <li><a href="/help/help-4-1" target="_blank">合作推广</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

</div>
<script>
  //////////////////////////////////////////////////////////
  $(function () {
    var Log = {
      Out: function (label, str) {
        var url = String(window.document.location.href);
        if (url.indexOf('http://www.quanminxiu.tv/') != -1 && url.indexOf('?debug') == -1) {
          return;
        }
        if (str) {
          console.log(label, str);
          return;
        }
        console.log(label);
      }
    };
    //首页123
    var HomePage = {
      Init: function () {
        HomePage.GetUserinfo.Init();
        HomePage.AnchorRecommend.Init();
        //HomePage.WeekStar.Init();
        HomePage.NewAnchor.Init();
        HomePage.AllAnchor.Init();
        HomePage.RightPage.RichRank.Init();
        HomePage.RightPage.StarRank.Init();
        HomePage.SlideBanner.MainBanner();
        if (_StateData.IsLogin) {
          HomePage.RightPage.MyFollow.Init();
        }
      },
      //公共方法
      CommonUtils: {
        Data: {
          IsHot: false
        },
        GetRandomRange: function (startNum, endNum) {
          return Math.floor((Math.random() * (endNum - startNum)) + startNum);
        },
        GetAnchorItem: function (isBig, Value, i, isCoser) {
          var time = (Value.Live == 1 && Value.Live_StartTime) ? moment().diff(moment(Value.Live_StartTime), "minutes") + "分钟前开播" : '即将开播';
          //直播 手机 ICON
          var _IsLive = (Value.Live) ? (Value.Live_IsMobile) ? '<i class="living living-mobile"></i>' : '<i class="living"></i>' : '';
          var _city = (Value.Account_City) ? Value.Account_City : '-';
          var _hotValue = (isCoser) ? Value.Anchor_HotValue : Value.Hot_Value;
          //头条ICON判断
          var _hotTag = '';
          /*if(i==0 && Value.Anchor_HotValue_Champion_Previous==1){
              _hotTag = ' anchor-top-0';
              HomePage.CommonUtils.Data.IsHot = true;
          }else{
              var ii = (HomePage.CommonUtils.Data.IsHot) ? i : i+1;
              _hotTag = ' anchor-top-'+(ii);
          }*/
          if (i == 0) {
            var ii = (!!Value.Live) ? '0' : '9';
            _hotTag = ' anchor-top-' + ii;
          } else if (i < 4) {
            var ii = (!!Value.Live) ? i : '9';
            _hotTag = ' anchor-top-' + ii;
          } else {
            _hotTag = ' anchor-top-' + i;
          }

          //小图
          var item1 = '<div class="host-col1 host-col-left' + _hotTag + '">' +
            '<div class="host-video-move">' +
            '<div class="img">' +
            '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserCover.fnURL(Value.User_ID, "146.146") + '">' +
            _IsLive +
            '</div>' +
            '<div class="info">' +
            '<p class="name">' +
            '<span class="tag-anchor-level ico-anchor-level-' + ((Value.Anchor_Level) ? Value.Anchor_Level : Value.Level) + '"></span>' + Value.NickName + '</p>' +
            '<p class="num">' + _hotValue + '</p>' +
            '<p class="address">' + _city + '</p>' +
            '<p class="time">' + time + '</p>' +
            '</div>' +
            '<a href="/room/' + Value.User_ID + '" target="_blank" class="link"></a>' +
            '</div>' +
            '</div>';

          var is9x9 = '4';
          var isPic = '294.294';
          //(i==0)?'9':'4';//首个大图
          //(i==0)?'442.442':'294.294';//首个大图
          //大图
          var item2 = '<div class="host-col' + is9x9 + ' host-col-left' + _hotTag + '">' +
            '<div class="host-video-move">' +
            '<div class="img">' +
            '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserCover.fnURL(Value.User_ID, isPic) + '">' +
            _IsLive +
            '</div>' +
            '<div class="info">' +
            '<p class="name">' +
            '<span class="tag-anchor-level ico-anchor-level-' + Value.Anchor_Level + '"></span>' + Value.NickName + '</p>' +
            '<p class="num">' + _hotValue + '</p>' +
            '<p class="address">' + _city + '</p>' +
            '<p class="time">' + time + '</p>' +
            '<p class="intro">' + Value.RoomTitle + '</p>' +
            '</div>' +
            '<a href="/room/' + Value.User_ID + '" target="_blank" class="link"></a>' +
            '</div>' +
            '</div>';
          return (isBig) ? item2 : item1;
        },
        Loading: function (isShow) {
          if (isShow) {
            HomePage.CommonUtils.Loading(false);
            var _Loading = '<div  id="_AjaxLoading" style="font-size:12px;text-align:center;margin-top:10px;margin-bottom: 10px;" class="XAjaxLoading"><img src="' + _VirtualPath.Static + '/main/image/common/loading.gif" style="width:20px;height:20px;vertical-align:middle;margin-right:5px;">加载中,请稍等</div>';
            $('#J_AllAnchor').after(_Loading);
          }
          else {
            $('#_AjaxLoading').remove();
          }
        }
      },
      //用户信息
      GetUserinfo: {
        Init: function () {
          if (_StateData.IsLogin) {
            $("#J_ProfileLogin").hide();
            $("#J_ProfileUserInfo").show();
            if (_StateData.IsAnchor) {
              $('#J_UserInfo_Nickname').attr('href', '/room/' + _StateData.User_ID).text(_StateData.NickName);
              $('#J_ProfileCtrlLive').attr('href', '/room/' + _StateData.User_ID).show().css({
                "display": "block"
              });
              $('#J_ProfileCtrlEntry').hide();
            } else {
              $('#J_UserInfo_Nickname').text(_StateData.NickName);
              $('#J_ProfileCtrlLive').hide();
              $('#J_ProfileCtrlEntry').attr('href', '/entry').show().css({
                "display": "block"
              });
            }

            $('#J_UserInfo_ID').text("ID:" + _StateData.User_ID);
            $('#J_UserInfo_Cover').attr('src', $.Common.ImageBind.UserAvatar.fnURL(_StateData.User_ID, "54.54"));
            $.CommonMain.User_UserInfo(function (json) {
              var prcent = (json.data.EXP / json.data.EXP_Next).toFixed(2) * 100 + "%";
              $("#J_MUser_Exp").css('width', prcent);
              $('#J_UserInfo_Coin').text(json.data.Coin);
              $('#J_UserInfo_Bean').text(json.data.Beans);
            });
          }
        }
      },
      //艺人推荐列表
      AnchorRecommend: {
        Data: {
          ItemCount: 0 //首页头部显示多少个艺人
        },
        Init: function () {
          HomePage.AnchorRecommend.Data.ItemCount = _PageData.HotAnchor.data.length;
          HomePage.AnchorRecommend.Result(_PageData.HotAnchor, {rand: [0, 1]});
          return;

          var _This = HomePage.AnchorRecommend;
          var Parm = _This.GetRandomIndex();
          HomePage.AnchorRecommend.Data.ItemCount = Parm.len;//记录这个，显示全部艺人，是否从，这个索引开始。
          Log.Out("加载头部 推荐艺人===>");
          $.ajax({
            url: '/ajaxs/rcommon.useranchorlisthot.get',
            type: 'post',
            dataType: 'json',
            data: {
              Start: 0,
              Length: Parm.len
            },
            success: function (data) {
              Log.Out("头部 推荐艺人 ", data);
              if (data.flag !== 0) return;
              HomePage.AnchorRecommend.Result(data, Parm);
            }
          });
        },
        Result: function (data, Parm) {
          $('#J_HostWall').empty();
          var aaData = HomePage.AnchorRecommend.BigPicSortData(data.data, Parm.rand);
          _.forEach(aaData, function (Value, i) {
            if (_.includes(Parm.rand, i)) {
              $('#J_HostWall').append(HomePage.CommonUtils.GetAnchorItem(true, Value, i));
            } else {
              $('#J_HostWall').append(HomePage.CommonUtils.GetAnchorItem(false, Value, i));
            }
          });
          $('#J_HostWall').masonry({
            itemSelector: '.host-col-left',
            columnWidth: 148
          });
        },
        GetRandomIndex: function () {
          //推荐 大图索引
          var arr = [[0, 1], [0, 6, 9], [0, 5, 8], [1, 5], [1, 11], [0, 3, 8], [4, 8], [0, 2, 8]];
          //arr = [ [0,1] ];
          var rIndex = parseInt(arr.length * Math.random());
          rIndex = 0;
          var rand = arr[rIndex];
          var len = 30 - (rand.length * 3);
          return {rand: rand, len: len};
        },
        //大图按热度 排序
        BigPicSortData: function (SourceArr, SortArr) {
          var BigPicArr = SourceArr.splice(0, SortArr.length);
          for (var i = 0; i < SortArr.length; i++) {
            SourceArr.splice(SortArr[i], 0, BigPicArr[i]);
          }
          return SourceArr;
        }
      },
      //礼物 周星榜
      WeekStar: {
        Init: function () {
          this.LoadWeekStarData();
        },
        //加载 相应礼物周星数据
        LoadWeekStarData: function () {
          var url = "/ajaxs/business.rediscommon-giftuserrankingweeklist";
          $.ajax({
            url: url,
            type: 'post',
            dataType: 'json',
            data: {
              Gift_ID: "WeekStar",//WeekStar:所有周星礼物 其它:礼物ID(多个用,号分隔)
              //Limit_G: 0,//送出人-获取数量 <=0:不获取 >0:取得数量
              Limit_R: 1//接收人-获取数量 <=0:不获取 >0:取得数量
            },
            success: function (data) {
              HomePage.WeekStar.Result(data);
            }
          });
        },
        Result: function (data) {
          Log.Out("周星数据结果", data);
          if (data.flag !== 0) {
            $.CommonMain.Modal_Tip(data.msg + "(" + data.flag + ")", {Timeout: 2000});
            return;
          }
          _.forEach(data.data, function (Value, i) {
            var AnchorInfo = Value.Ranking_R[0];
            if (AnchorInfo) {
              var _Live = '';
              if (AnchorInfo.Live != undefined && AnchorInfo.Live == 1) {
                _Live = '<i class="living"></i>';
              }
              var _Html = '<div class="week-col-left">' +
                '<a href="/room/' + AnchorInfo.User_ID + '" class="img" target="_blank">' +
                '<img alt="' + AnchorInfo.NickName + '" src="' + $.Common.ImageBind.UserCover.fnURL(AnchorInfo.User_ID, "294.294") + '">' +
                _Live +
                '<div class="info">' +
                '<p class="name"><span class="tag-anchor-level ico-anchor-level-' + AnchorInfo.Level + '"></span>' + AnchorInfo.NickName + '</p>' +
                '</div>' +
                '</a>' +
                '<p class="gift">' +
                '<img src="<%- Virtual_Path.Static %>main/image/room/gift/' + Value.Gift_ID + '.png" alt="gift">' +
                '</p>' +
                '<h4 class="info">' +
                '收到<span class="num">' + AnchorInfo.Gift_Num + '</span>个' + Value.Gift_Name +
                '</h4>' +
                '</div>';
              $('#J_AnchorWeekRankList').append(_Html);
            }

          });
          this.SliderWeek();
        },
        //左右滑动
        SliderWeek: function () {
          var _ThisLen = $("#J_AnchorWeekRankList .week-col-left").length;
          var _ThisSingW = $("#J_AnchorWeekRankList .week-col-left").outerWidth(true);
          var _Thisindex = 0;
          var _Timer;
          $("#J_AnchorWeekBtnL").on("mouseenter", function () {
            LeftPage();
            _Timer = setInterval(LeftPage, 750);
          });
          $("#J_AnchorWeekBtnR").on("mouseenter", function () {
            RightPage();
            _Timer = setInterval(RightPage, 750);
          });

          function LeftPage() {
            StopInterval();
            var _ThisOutW = $("#J_AnchorWeekRank").width();
            var ListMaxLength = Math.floor(_ThisOutW / _ThisSingW);
            if (_Thisindex >= _ThisLen - ListMaxLength) {
              StopInterval();
              return
            }
            ;
            _Thisindex++;
            $("#J_AnchorWeekRankList").stop(1, 1).css({
              marginLeft: -_ThisSingW * _Thisindex
            });

          }

          function RightPage() {
            StopInterval();
            if (_Thisindex < 1) {
              StopInterval();
              return;
            }
            _Thisindex--;
            $("#J_AnchorWeekRankList").stop(1, 1).css({
              marginLeft: _ThisSingW * _Thisindex
            });

          }

          function StopInterval() {
            clearInterval(_Timer);
          }
        }
      },
      //新艺人 后起之秀
      NewAnchor: {
        Init: function () {
          this.LoadNewAnchorData();
        },
        LoadNewAnchorData: function () {
          var url = '/ajaxs/rcommon.useranchorlistnew.get';
          $.ajax({
            url: url,
            type: 'post',
            dataType: 'json',
            data: {
              Start: 0,
              Length: 8,
            },
            success: function (data) {
              HomePage.NewAnchor.Result(data);
            }
          });
        },
        Result: function (data) {
          Log.Out("后起之秀结果", data);
          if (data.flag !== 0) {
            $.CommonMain.Modal_Tip(data.msg + "(" + data.flag + ")", {Timeout: 2000});
            return;
          }
          var _html = '';
          _.forEach(data.data, function (Value, i) {
            _html += HomePage.CommonUtils.GetAnchorItem(false, Value, i, false);
          });
          $('#J_AnchorNewList').empty().append(_html);
        }
      },
      //全部艺人
      AllAnchor: {
        Data: {
          TempTimeout: 0,//加载延时
          IsCanLoad: true, //是否可以 加载中
          StartIndex: 0, //开始索引
          IsLoadEnd: false, //是否 加载到最后结束
          ReceiveDataLength: 0 //接收数据长度
        },
        Init: function () {
          HomePage.AllAnchor.Data.StartIndex = HomePage.AnchorRecommend.Data.ItemCount - 6; //全部艺人，是否接着推荐内容的索引。
          HomePage.AllAnchor.InitScroll();
        },
        InitScroll: function () {
          var offsettop = 0;
          document.onscroll = function () {
            var xs_div = document.getElementById('J_AllAnchor');
            var xs_d_h = xs_div.scrollHeight;
            var docTop = document.body.scrollTop | document.documentElement.scrollTop;
            docTop += offsettop;
            if (docTop > xs_d_h) {
              if (HomePage.AllAnchor.Data.IsCanLoad) {
                HomePage.AllAnchor.Data.IsCanLoad = false;
                //HomePage.AllAnchor.LoadAnchorData();
                HomePage.AllAnchor.Data.TempTimeout = setTimeout(HomePage.AllAnchor.LoadAnchorData, 100);
              }
            }
          };
        },
        LoadAnchorData: function () {
          var Parm = HomePage.AllAnchor.GetRandomIndex();
          if (HomePage.AllAnchor.Data.IsLoadEnd) return;
          HomePage.CommonUtils.Loading(true);
          Log.Out("全部艺人范围：", [String("Start:" + HomePage.AllAnchor.Data.StartIndex), String("Length:" + Parm.len)]);
          $.ajax({
            url: '/ajaxs/rcommon.useranchorlisthot.get',
            type: 'post',
            dataType: 'json',
            data: {
              Start: HomePage.AllAnchor.Data.StartIndex,
              Length: Parm.len
            },
            success: function (data) {
              HomePage.AllAnchor.Result(data, Parm);
            }
          });
        },
        Result: function (data, Parm) {
          Log.Out("全部艺人数据", data);
          $('#_AjaxLoading').remove();
          if (data.flag !== 0) {
            $.CommonMain.Modal_Tip(data.msg + "(" + data.flag + ")", {Timeout: 2000});
            return;
          }
          var aaData = data.data;
          if (aaData.length < Parm.len) HomePage.AllAnchor.Data.IsLoadEnd = true;

          HomePage.AllAnchor.Data.StartIndex += Parm.len;
          var _html = '';
          for (var i = 0; i < aaData.length; i++) {
            _html += HomePage.AllAnchor.GetAnchorItem(aaData[i], i);
          }
          $('#J_AllAnchor').append(_html);
          HomePage.AllAnchor.Data.IsCanLoad = true;
          HomePage.CommonUtils.Loading(false);
        },
        GetAnchorItem: function (Value, Index) {
          //开播 时间
          var TimeStr = (Value.Live == 1 && Value.Live_StartTime) ? moment().diff(moment(Value.Live_StartTime), "minutes") + "分钟前开播" : '即将开播';
          //直播 手机 ICON
          var LiveStr = (Value.Live) ? (Value.Live_IsMobile) ? '<i class="living living-mobile"></i>' : '<i class="living"></i>' : '';
          //热度
          var AnchorHotValue = (Value.HotValue > 1000000) ? '<p class="num">' + Math.round(Value.Anchor_HotValue / 1000) / 10 + '万</p>' : ((Value.Anchor_HotValue > 0) ? '<p class="num">' + Value.Anchor_HotValue + '</p>' : "");

          var html = '<div class="host-col1 host-col-left">' +
            '<div class="host-video-info">' +
            '<div class="img">' +
            '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserCover.fnURL(Value.User_ID, "200.200") + '">' +
            LiveStr +
            '</div>' +
            '<div class="info">' +
            '<p class="intro">' + Value.RoomTitle + '</p>' +
            AnchorHotValue +
            '<p class="time">' + TimeStr + '</p>' +
            '</div>' +
            '<a href="/room/' + Value.User_ID + '" target="_blank" class="link">' +
            '<i class="player"></i>' +
            '<span class="name">' + Value.NickName + '</span>' +
            '</a>' +
            '</div>' +
            '</div>';
          return html;
        },
        GetRandomIndex: function () {
//                    var arr = [ [0,9,19,23] ];
//                    var rIndex = parseInt(arr.length * Math.random());
          var rand = getRA();
          var len = 24 * 2 - (rand.length * 3);//总数:24的倍数,因为1排8或6个

          function getRA() {
            var a = [];
            for (var i = 0; i < 4; i++) {
              var r = HomePage.CommonUtils.GetRandomRange(0, 10) + 10 * i;
              a.push(r);
            }
            return a;
          }

          return {rand: rand, len: len};
        }
      },
      //右侧内容
      RightPage: {
        //富豪榜
        RichRank: {
          Init: function () {
            $.ajax({
              url: '/ajax/user.user-info.page',
              type: 'post',
              dataType: 'json',
              data: {
                Cache: true,//缓存
                P_Get: true,
                P_Total: 0,//总条数
                P_MaxCode: "",//MaxCode
                iDisplayStart: 0,//开始
                iDisplayLength: 6,//页长度
                Sort_Col: "Coin_Total"
              },
              success: function (data) {
                if (data.flag !== 0) {
                  $.CommonMain.Modal_Tip(data.msg + "(" + data.flag + ")", {Timeout: 2000});
                  return;
                }

                var _html = '';
                _.forEach(data.aaData, function (Value, n) {
                  var i = n + 1;
                  _html += '<li>' +
                    '<a href="/rank" target="_blank">' +
                    '<span class="rank-num rank-num-' + i + '">' + i + '</span>' +
                    '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserAvatar.fnURL(Value.User_ID, "54.54") + '" class="cover">' +
                    '<span class="tag-user-level ico-level-' + Value.Level.Level + '"></span>' +
                    '<span class="nickname">' + Value.NickName + '</span>' +
                    '</a>' +
                    '</li>';
                });
                $('#J_RichRankList').empty().append(_html);
              }
            });
          }
        },
        //明星榜
        StarRank: {
          Init: function () {
            $.ajax({
              url: '/ajax/user.user-anchor.page',
              type: 'post',
              dataType: 'json',
              data: {
                Cache: true,//缓存
                P_Get: true,
                P_Total: 0,//总条数
                P_MaxCode: "",//MaxCode
                iDisplayStart: 0,//开始
                iDisplayLength: 6,//页长度
                Sort_Col: "Beans_Total"
              },
              success: function (data) {
                if (data.flag !== 0) {
                  $.CommonMain.Modal_Tip(data.msg + "(" + data.flag + ")", {Timeout: 2000});
                  return;
                }

                var _html = '';
                _.forEach(data.aaData, function (Value, n) {
                  var i = n + 1;
                  _html += '<li>' +
                    '<a href="/room/' + Value.User_ID + '" target="_blank">' +
                    '<span class="rank-num rank-num-' + i + '">' + i + '</span>' +
                    '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserAvatar.fnURL(Value.User_ID, "54.54") + '" class="cover">' +
                    '<span class="tag-anchor-level ico-anchor-level-' + Value.Anchor_Level + '"></span>' +
                    '<span class="nickname">' + Value.NickName + '</span>' +
                    '</a>' +
                    '</li>';
                });
                $('#J_StarRankList').empty().append(_html);
              }
            });
          },
        },
        //我的关注
        MyFollow: {
          Init: function () {
            $.ajax({
              url: '/ajax/user.user-attention.page',
              type: 'post',
              dataType: 'json',
              data: {
                Cache: true,//缓存
                P_Get: true,
                P_Total: 0,//总条数
                P_MaxCode: "",//MaxCode
                iDisplayStart: 0,//开始
                iDisplayLength: 6,//页长度
                Sort_Col: "Beans_Total"
              },
              success: function (data) {
                if (data.flag !== 0) {
                  $.CommonMain.Modal_Tip(data.msg, {Timeout: 2000});
                  return;
                }

                if (data.aaData.length < 1) {
                  return;
                }

                $("#J_MyFollowMod").show();
                var _html = '';

                _.forEach(data.aaData, function (Value) {
                  var _Live = '';
                  if (Value.Live == 1) {
                    _Live = '<i class="living"></i>';
                  }
//                                    if(Value.Live == 1 && Value.Live_IsMobile == 1){
//                                        _Live = '<i class="living-mobile"></i>';
//                                    }
                  _html += '<li>' +
                    '<a href="/room/' + Value.User_ID + '" target="_blank">' +
                    '<img alt="' + Value.NickName + '" src="' + $.Common.ImageBind.UserAvatar.fnURL(Value.User_ID, "54.54") + '" class="cover">' +
                    '<span class="nickname">' + Value.NickName + '</span>' +
                    '<p class="hotheart">' + Value.Anchor_HotValue + '</p>' +
                    _Live +
                    '</a>' +
                    '</li>';
                });

                $('#J_MyFollowList').empty().append(_html);
              }
            });
          },
        }
      },
      SlideBanner: {
        MainBanner: function () {
          if ($("#J_SlideMainBanner > a").length < 2) {
            return;
          }
          $("#J_SlideMainBanner").slide({
            slideContainer: $('#J_SlideMainBanner > a'),
            effect: 'easeOutCirc',
            autoRunTime: 3000,
            slideSpeed: 500,
            nav: true,
            autoRun: true,
            prevBtn: $('a.prev'),
            nextBtn: $('a.next')
          })
        }
      },
    };
    HomePage.Init();
  });
</script>

